package com.itheima.paymentdemo.service;

import org.springframework.transaction.annotation.Transactional;

import java.io.IOException;
import java.security.GeneralSecurityException;
import java.util.Map;

public interface WxPayService {
    Map<String, Object> nativePay(Long productId) throws IOException;

    void processOrder(Map<String, Object> bodyMap) throws GeneralSecurityException;

    void cancelOrder(String orderNo) throws IOException, Exception;

    String queryOrder(String orderNo) throws IOException, Exception;

    void checkOrderStatus(String orderNo) throws Exception;

    /**
     * 退款
     * @param orderNo
     * @param reason
     */
    void refund(String orderNo, String reason) throws IOException;

    String queryRefund(String refundNo) throws IOException, Exception;

    @Transactional(rollbackFor = Exception.class)
    void checkRefundStatus(String refundNo) throws Exception;

    void processRefund(Map<String, Object> bodyMap) throws Exception;

    String queryBill(String billDate, String type) throws Exception;

    String downloadBill(String billDate, String type) throws Exception;

    Map<String, Object> nativePayV2(Long productId, String remoteAddr) throws Exception;
}
